<template>
  <div class="SubMenu">
    <div class="history_box">
      <div class="add_btn">
        <i class="icon_add"></i>
        <span>新建教学设计</span>
      </div>
      <span>历史记录</span>
      <a-menu>
        <a-menu-item v-for="(item, key) in historyList" :key="key" @click="titleClick(item)">
          <i class="icon"></i>
          {{ item.name }}
        </a-menu-item>
      </a-menu>
    </div>

    <div class="btn_box">
      <a-button  type="danger" @click="showDownload">下载管理</a-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'subMenu',
  data() {
    return {
      historyList: [
        {name: '教学设计方案'},
        {name: '教学设计方案2'},
        {name: '教学设计方案3'},
        {name: '教学设计方案4'},
        {name: '教学设计方案5'},
        {name: '教学设计方案6'},
      ]
    }
  }, 

  methods: {

    showDownload() {
      this.$store.commit('setDrawerVisible', true)
    },

    titleClick(item) {
      // this.$emit("titleClick", item)
    },
    addClick() {
      console.log("addClick")
    }
  }

}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.SubMenu {
  height: 100%;
  position: relative;
  padding-bottom: 40px;
  box-sizing: border-box;
  border-right: 1px solid rgba(255, 218, 218, 1);


  .add_btn {
    display: flex;
    align-items: center;
    cursor: pointer;
    // margin: 5px 0;;
    margin-bottom: 10px;
    i {
      width: 16px;
      height: 16px;
      background: url('../assets/img/add.png') 0 0 no-repeat;
      background-size: 100%;
      display: inline-block;
      margin-right: 5px;
    }
    span {
      font-size: 12px;
      color: rgba(154, 0, 0, 1) !important;
    }
  }
  .ant-menu-vertical {
    border-right: none;
  }

  
  .ant-menu-item-selected {
    background: rgba(191, 95, 95, 0.1);
  }

  .history_box {
    padding: 10px 10px;
    box-sizing: border-box;
    .ant-menu-item {
      color: rgba(135, 143, 156, 1);
      font-size: 14px;
      display: flex;
      align-items: center;
    }
    
    .icon {
      display: inline-block;
      width: 16px;
      height: 16px;
      background: url('../assets/img/his_icon1.png') 0 0 no-repeat;
      background-size: 100%;
      margin-right: 5px;
    }

    .ant-menu-item-selected {
      .icon {
        background: url('../assets/img/his_icon2.png') 0 0 no-repeat;
        background-size: 100%;
      }
    }

    span {
      font-size: 12px;
      color: rgba(10, 15, 44, 0.85)
    }
  }

  .btn_box {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index:10;
    bottom: 30px;
    text-align:center;

    button {
      width: 118px;
      height: 30px;
    }

    button+button {
      margin-top: 10px;
    }
  }

}
</style>
